home *** CD-ROM | disk | FTP | other *** search
- program dtctest;
-
- {$v-}
- {$c-}
- {$i-}
- {$r-}
- {$u-}
- {$k-}
-
- const ploton=^f;plotoff=^[^f;cr=^m;lf=^j;
-
- type testidtype=(hrt,vrt,dst,shft,xt);str255=string[255];
- regpack=record
- ax,bx,cx,dx,bp,si,di,ds,es,flags:integer;
- end;
- var which:testidtype;portno:integer;biospack:regpack;chb:char;
-
- procedure setupport;
- begin
- biospack.ax:=$5a; { $5a = 010 11 0 10 }
- { | | | |-- 7 bits/char }
- { | | |----- 1 stop bit }
- { | |------- even parity }
- { |---------- 300 baud }
- biospack.dx:=portno;
- intr($14,biospack); {call rs232_io bios routine to setup comm port}
-
- end; {setupport}
-
- procedure print(ptext:str255);
- var i,inch,outch,cstat:integer;
- begin
- for i:=1 to length(ptext) do begin
- outch:=$0100 or ord(ptext[i]); {ah=1 to send, al=char to send}
- biospack.dx:=portno;
- repeat
- biospack.ax:=$0300; {get status and see if a char is ready}
- intr($14,biospack);
- if (hi(biospack.ax) and $01) = 1 then begin
- biospack.ax:=$0200; {receive a char}
- intr($14,biospack); {see if ^s was pressed}
- cstat:=hi(biospack.ax);
- inch:=lo(biospack.ax);
- if (cstat = 0) and (inch = 19) then repeat
- biospack.ax:=$0200;
- intr($14,biospack);
- cstat:=hi(biospack.ax);
- inch:=lo(biospack.ax);
- until (cstat=0) and (inch=17);
- end;
- biospack.ax:=outch;
- intr($14,biospack);
- cstat:=hi(biospack.ax);
- until cstat and $80 = 0;
- end;
- end; {print}
-
- procedure runmsg(testname:str255);
- var i:integer;
- begin
- clrscr;
- i:=length(testname) div 2;
- if i<32 then i:=32-i else i:=1;
- highvideo;
- gotoxy(i,12);write(concat('*** RUNNING ',testname,' ***'));
- gotoxy(27,15);write('PRESS ANY KEY TO KILL TEST');
- lowvideo;
- print(cr+lf+'*** '+testname+' ***');
- end; {runmsg}
-
- procedure ready;
- var yesno:char;
- begin
- clrscr;
- repeat
- gotoxy(15,12);write('Is PITCH set to 12 and ELITE 12 wheel installed ? ');
- read(yesno);
- until (upcase(yesno)='Y');
- repeat
- gotoxy(15,13);write('Which comm port is the DTC cabled to (1/2) ? ');
- read(yesno);
- until (yesno='1') or (yesno='2');
- portno:=ord(yesno)-49;
- repeat
- gotoxy(15,14);write('Is the DTC on-line and is PLOT switch set to ON ? ');
- read(yesno);
- until (upcase(yesno)='Y');
- end; {ready}
-
- procedure dohrt;
- label killtest;
- var i:integer;spaces:string[80];
-
- procedure newline;
- begin
- print(plotoff+cr+lf+ploton);
- end; {newline}
-
- begin
- print(plotoff);
- runmsg('HORIZONTAL RESOLUTION TEST');
- newline;
- for i:=1 to 512 do if keypressed then goto killtest
- else print('| ');
- newline;spaces:=' ';
- for i:=1 to 256 do if keypressed then goto killtest
- else print(spaces+'|'+spaces);
- newline;print(' ');spaces:=spaces+spaces;
- for i:=1 to 128 do if keypressed then goto killtest
- else print (spaces+'|'+spaces);
- newline;print(' ');spaces:=spaces+spaces;
- for i:=1 to 64 do if keypressed then goto killtest
- else print(spaces+'|'+spaces);
- newline;print(' ');spaces:=spaces+spaces;
- for i:=1 to 32 do if keypressed then goto killtest
- else print(spaces+'|'+spaces);
- newline;print(' ');spaces:=spaces+spaces;
- for i:=1 to 16 do if keypressed then goto killtest
- else print(spaces+'|'+spaces);
- newline;print(' ');spaces:=spaces+spaces;
- for i:=1 to 8 do if keypressed then goto killtest
- else print(spaces+'|'+spaces);
- newline;
- killtest:print(plotoff+cr+lf);
- end; {dohrt}
-
- procedure dovrt;
- label killtest;
- var i:integer;
-
- procedure testline(dtext:str255);
- begin
- print(dtext);
- if not keypressed then print(cr+ploton+lf+plotoff);
- end; {testline}
-
- begin
- print(plotoff+cr+lf);
- runmsg('VERTICAL RESOLUTION TEST');
- print(cr+lf);
- for i:=1 to 16 do begin
- testline('-----'); if keypressed then goto killtest;
- testline('-'); if keypressed then goto killtest;
- testline('--'); if keypressed then goto killtest;
- testline('-'); if keypressed then goto killtest;
- testline('---'); if keypressed then goto killtest;
- testline('-'); if keypressed then goto killtest;
- testline('--'); if keypressed then goto killtest;
- testline('-'); if keypressed then goto killtest;
- testline('----'); if keypressed then goto killtest;
- testline('-'); if keypressed then goto killtest;
- testline('--'); if keypressed then goto killtest;
- testline('-'); if keypressed then goto killtest;
- testline('---'); if keypressed then goto killtest;
- testline('-'); if keypressed then goto killtest;
- testline('--'); if keypressed then goto killtest;
- testline('-'); if keypressed then goto killtest;
- end;
- killtest:print(plotoff+cr+lf);
- end; {dovrt}
-
- procedure dodst;
- label killtest;
- var i:integer;
-
- begin
- runmsg('DESCENDERS TEST');
- for i:=1 to 16 do begin
- print(plotoff+cr+lf);
- print('__________________________________________________________'+cr+lf);
- if keypressed then goto killtest;
- print(';;;;;;QQQQQ......,,,,,,yyyyyyypppppppgggggggjjjjjjj3333333'+cr+lf);
- if keypressed then goto killtest;
- end;
- killtest:;
- end; {dodst}
-
- procedure doshft;
- label killtest;
- var i:integer;
-
- begin
- runmsg('SHORT HAMMER FIRE TEST');
- for i:=1 to 16 do begin
- print(plotoff+cr+lf);
- if keypressed then goto killtest;
- print(',,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,'+cr+lf);
- if keypressed then goto killtest;
- print('..........................................................'+cr+lf);
- if keypressed then goto killtest;
- print('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~'+cr+lf);
- if keypressed then goto killtest;
- print('//////////////////////////////////////////////////////////'+cr+lf);
- if keypressed then goto killtest;
- print('----------------------------------------------------------'+cr+lf);
- if keypressed then goto killtest;
- print('\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'+cr+lf);
- if keypressed then goto killtest;
- print('^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^'+cr+lf);
- if keypressed then goto killtest;
- print('""""""""""""""""""""""""""""""""""""""""""""""""""""""""""'+cr+lf);
- end;
- killtest:;
- end; {doshft}
-
- procedure menu(var testid:testidtype);
- var choice:char;
- begin
- clrscr;
- gotoxy(20,1);
- highvideo;write('*** DTC PRINT QUALITY TEST ***');
- gotoxy(20,3);write('1:Horizontal Resolution Test');
- gotoxy(20,4);write('2:Vertical Resolution Test');
- gotoxy(20,5);write('3:Descenders Test');
- gotoxy(20,6);write('4:Short Hammer Fire Test');
- gotoxy(20,7);write('5:Exit Tests');
- repeat
- gotoxy(8,9);highvideo;write('Selection ? ');
- highvideo;read(choice);
- until choice in ['1'..'5'];
- case choice of
- '1':testid:=hrt;
- '2':testid:=vrt;
- '3':testid:=dst;
- '4':testid:=shft;
- '5':testid:=xt;
- end;
- end; {menu}
-
- begin {dtctest}
- ready;
- setupport;
- repeat
- menu(which);
- case which of
- hrt:dohrt;
- vrt:dovrt;
- dst:dodst;
- shft:doshft;
- xt:;
- end;
- while keypressed do read(kbd,chb);
- until which=xt;
- textmode(bw80);
- print(plotoff+cr+lf);
- end. {dtctest}